<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>1.Flex</title>
  <style>
    .container {
      display: flex;
      color: #fff;
      background: #ccc;
      width: 800px;
      margin: 30px auto;
      text-align: center;
      height: 200px;
    }

    .sidebar {
      background: #3BA0E9;
      padding-top: 40px;
      flex: 1;
    }
    .main {
      flex: 4;
      display: flex;
      flex-direction: column;
    }

    .header, .footer {
      flex: 1;
      background: #7DBCEA;
    }
    .content {
      flex: 2;
      background: #108EE9;
    }

    .flex-centered-inner {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="sidebar">sidebar</div>
    <div class="main">
      <div class="header flex-centered-inner">Header</div>
      <div class="content flex-centered-inner">Content</div>
      <div class="footer flex-centered-inner">Footer</div>
    </div>
  </div>
</body>
</html>